import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;

public class Rectangle extends SceneGraphNode {
  public static final float SIN_60 = (float)Math.sin(Math.PI / 3);

  public Rectangle() {
    this(true);
  }
  
  public Rectangle(boolean pickable) {
    super(pickable);
  }
  
  public void renderGeometry(GLAutoDrawable drawable) {
    GL2 gl = drawable.getGL().getGL2();
    //gl.glPushMatrix();
    gl.glBegin(GL.GL_TRIANGLES);
    gl.glColor3f(0, 0, 1);
    gl.glVertex2f(-1f, 0.5f);
    gl.glColor3f(1, 0, 0);
    gl.glVertex2f(-1f, -0.5f);
    gl.glColor3f(0, 1, 0);
    gl.glVertex2f(1.0f, -.5f);
    gl.glEnd();
    //gl.glPopMatrix();
  
    GL2 gl2 = drawable.getGL().getGL2();
    gl2.glBegin(GL.GL_TRIANGLES);
    gl2.glColor3f(1, 0, 0);
    gl2.glVertex2f(1f, 0.5f);
    gl2.glColor3f(0, 1, 0);
    gl2.glVertex2f(1f, -0.5f);
    gl2.glColor3f(0, 0, 1);
    gl2.glVertex2f(-1.0f, .5f);
    gl2.glEnd();
  
  
  }
}
